/* License Notice:
**
** This program is free software: you can redistribute it and/or modify
**    it under the terms of the GNU General Public License as published by
**    the Free Software Foundation, either version 3 of the License, or
**    (at your option) any later version.
** This program is distributed in the hope that it will be useful,
**   but WITHOUT ANY WARRANTY; without even the implied warranty of
**   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
**   GNU General Public License for more details.
** You should have received a copy of the GNU General Public License
**   along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

/**
 * @file command.hpp
 * @author TooOld2Rock'nRoll
 * @date 2023/08/25
 * @brief Command interface for the ArcadeFighter library.
 *
 * Implemented following Robert Nystrom's book <i>Game Programming Patterns</i>.
 *
 * @see https://gameprogrammingpatterns.com/command.html
 */
#ifndef _COMMAND_HPP_
#define _COMMAND_HPP_

/*---- Includes ----*/


/*---- Class Declaration ----*/
/**
 * @brief Enables the creation of arrays of commands of different Characters sub classes!
 * @warning Should <b>not!</b> be used directly outside of this context!!!
 */
class AbstractCommand
{
    public:
        virtual ~AbstractCommand () {};
};//END AbstractCommand

/**
 * @brief Command Interface
 *
 * Base class for all the commands in the game.
 *
 * @tparam P - the puppet class.
 */
template <typename P>
class Command : public AbstractCommand
{
    public:
        /** @brief Executes a Command, to be overridden by child classes. */
        virtual void execute (P &puppet, double delta_t) = 0;
};//END Command


/** @brief A Command that does nothing, useful to fill in behaviors not implemented. */
template <typename P>
class EmptyCommand : public Command<P>
{
    public:
        /** @brief A Command that does nothing... */
        virtual void execute (P &puppet, double delta_t) override final {  }
};//END EmptyCommand

#endif //_COMMAND_HPP_

